home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / internet / net commander 1.0 / ISP / SCRPTLST / REALTIME.CMD < prev    next >
Encoding:
Text File  |  1996-02-13  |  4.4 KB  |  152 lines

  1. #       Real/Time Login script for WINSOCK 2.0
  2. #       Configured for 28.8K modem bank
  3. #
  4. #-------------------------------------------------------------------------
  5. display "$Id: login.cmd,v 4.4 1995/12/11 08:54:52 fmouse Exp $"\n\n
  6. #-------------------------------------------------------------------------
  7. # To configure flow control for your modem, run setup.cmd
  8. # to configure your dialing sequence, run dialprfx.cmd
  9.  
  10. # $bombout is the number of non-busy dial retries through which to cycle
  11. # before declaring a timeout bombout.
  12. %bombout = 7
  13.  
  14. load $rnumb
  15. load $setup
  16. load $PPPsetup
  17. load $dialpre
  18. load $modemsetup
  19. load $modsetup2
  20. $goodport = "Y"
  21. $sresp = "Y"
  22. %restart = 0
  23.  
  24. if ($PPPsetup <> "YES")
  25.     display \nUSERNAME AND PASSWORD:\n\n
  26.     display \nPlease select \"PPP options\" from the Trumpet Winsock\n
  27.     display File menu and enter your username and password.\n\n
  28.     display IMPORTANT: You must prefix your username with an\n
  29.     display uppercase \"P\".  For example, if your login ID is\n
  30.     display \"joe\", enter your username as \"Pjoe\".\n\n
  31.     display Please do this now, and then run \"Login\" from\n
  32.     display the Trumpet Winsock Dialler menu.\n\n
  33.     $PPPsetup = "YES"
  34.     save $PPPsetup
  35.     abort
  36. end
  37.  
  38. while ($setup <> "YES")
  39.    if [query $dialpre  DIALING PREFIX: \(\"*70,\" to disable call waiting\)]
  40.    end
  41.    if [query $goodport SLIP PORT:  Set to \(COM\) %slipport. OK? \(Y or N\)]
  42.    end
  43.    $ugp = upper($goodport)
  44.    if pos("N",$ugp) > 0
  45.       %restart = 1
  46.    end
  47.    if [query $sresp Did you answer the questions correctly? \(Y or N\)]
  48.    else
  49.       $sresp = "N"
  50.    end
  51.    $usresp = upper($sresp)
  52.    if pos("Y",$usresp) > 0
  53.       $setup = "YES"
  54.    end
  55. end
  56. save $setup
  57. save $dialpre
  58.  
  59. if %restart = 1
  60.    display \nSLIP PORT NUMBER:\n\n
  61.    display Select \"Setup\" from the File menu and set the SLIP\n
  62.    display Port entry to correspond to the COM port on your\n
  63.    display computer to which your modem is connected.  After\n
  64.    display doing this, close Trumpet Winsock (Alt-F4) and restart\n
  65.    display it.  If your setup is correct, Trumpet Winsock should\n
  66.    display dial and connect to Real/Time\'s 28.8K modem bank.\n\n
  67.    abort
  68. end
  69.  
  70. #--------Initialize Modem:----------
  71.  
  72. output "ATZ"\13
  73. if ![input 5 "OK"]
  74.    display \nABORTING.  Your modem is not responding.\n
  75.    display Please check your phone line connection\n
  76.    display and Slip port setting in the File | Setup\n
  77.    display dialog box.\n
  78.    abort
  79. end
  80. output AT$modemsetup$modsetup2\13
  81. if [input 5 "OK"]
  82.    display \nMODEM INITIALIZATION SUCCESSFUL!\n
  83. else
  84.    display \nABORTING.  Modem initialization problem.\n
  85.    display Please run the setup script from the\n
  86.    display Trumpet Winsock Dialler menu.\n
  87.    abort
  88. end
  89.  
  90. #--------Dial phone number:---------
  91. %n = 0
  92. %nw = 0
  93. %ok = 0
  94. %timeout = 0
  95.  
  96. repeat
  97.   $dialnum = $rnumb
  98.   $result = ""
  99.   sleep 1
  100.   %n = %n +1
  101.   display "DIAL ATTEMPT: "%n
  102.   outputecho "ATDT"$dialpre$dialnum\13
  103.   while (!pos("CONNECT", $result) & !pos("NO DIAL", $result) & !pos("BUSY", $result) & !%timeout)
  104.       %timeout = ![read 60 $result]
  105.   end
  106.   if %timeout
  107.      display \n"TIMEOUT"\n
  108.      if %n <= %bombout
  109.          %ok = 0
  110.          %timeout = 0
  111.      else
  112.          display \nABORTING.  Too many timeouts\n
  113.          display Your Slip port setting in the File | Setup\n 
  114.          display dialog box may be incorrect.  Please re-run\n 
  115.          display Login from the Dialler menu.\n
  116.          $setup = "NO"
  117.          save $setup
  118.          abort
  119.      end
  120.   else
  121.      if pos("NO DIAL", $result)
  122.         display Your modem is not connected to your phone line\n
  123.         display or your phone is already off hook.   Please\n
  124.         display check your phone line.\n\n
  125.         display Select \"Login\" from the Dialler menu to try again.\n
  126.         abort
  127.      end
  128.      if $result = "BUSY"
  129.         %ok = 0
  130.      else
  131.         if pos("CONNECT",$result) > 0
  132.            %ok = 1
  133.         else
  134.            display \nYour modem failed to connect and reported the\n 
  135.            display "following error:  "
  136.            display $result
  137.            abort
  138.         end
  139.      end
  140.   end
  141. until %ok = 1 
  142.  
  143. # Wait for DCD:
  144. if [wait 30 dcd]
  145.     display \nConnection Established.  Starting PPP negotiation.\n
  146. else
  147.     display \nDCD line change not detected.\n
  148.     display Trumpet can't tell if your modem is connected.\n
  149. end
  150. sleep 2
  151. online
  152.